package data

type Spec struct {
	ID      uint `gorm:"primaryKey`
	Name    string
	Version string
}

type Label struct {
	ID      uint `gorm:"primaryKey"repo:"select"`
	IEID    uint
	Chapter int16
	Unit    int16
	Section int16
	Item    string
	Name    string `gorm:"-:all"`
}
type Pair struct {
	Name   string
	Length int16
}
type IESpec struct {
	ID      uint `gorm:"primaryKey"repo:"select"`
	IEID    uint
	Type    int8
	Iei     int8
	Lt      int8
	Values  []Pair   `gorm:"-:all"`
	Rows    [][]Pair `gorm:"-:all"`
	Headers []Pair   `gorm:"-:all"`
}

type InfoElement struct {
	ID     uint `gorm:"primaryKey"repo:"select"`
	SpecId uint
	Label  *Label  `gorm:"-:all"`
	IeSpec *IESpec `gorm:"-:all"`
	Name   string
	Desc   string
	Brief  string
}

type TableData struct {
	Header []KVPair
	Rows   [][]KVPair
}

type KVPair struct {
	K string
	V int32
}
